<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>position</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        .main {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        .left {
            height: 100px;
            background-color: red;
        }

        .center {
            background-color: blue;
            word-break: break-word;
            flex-grow: 1;
        }

        .right {
            background-color: red;
            height: 100px;
        }
    </style>
</head>

<body>
    <div class="main">
        <div class="left">上</div>
        <div class="center">中
            <h2>flex布局实现上中下三栏布局，父容器display:flex,flex-direction: column;且需要设置高度100vh，上下盒子定高，中间盒子flex-grow:1</h2>
            <h2>绝对定位同样也能实现上中下三栏布局</h2>    
        </div>
        <div class="right">下</div>
    </div>
</body>

</html>